CompressPictureFile
TheCompressPictureFile
function compresses a single-frame image stored as a picture file (PICT file) and places the result in another picture file.
pascal OSErr CompressPictureFile (short srcRefNum, short dstRefNum, CodecQ quality, CodecType cType);
srcRefNum
- Contains a file reference number for the source PICT file.
dstRefNum
- Contains a file reference number for the destination PICT file. Note that the compressor overwrites the contents of the file referred to by
dstRefNum
. You must open this file with write permission. The destination file can be the same as the source file specified by thesrcRefNum
parameter.quality
- Specifies the desired compressed image quality. See "Compression Quality Constants" on page 3-57 for available values.
cType
- Specifies a compressor type. You must set this parameter to a
valid compressor type (see Table 3-3 on page 3-64 for a list of the available compressor types). If the value passed in is 0, or'raw '
, and the source picture is compressed, the destination picture is created as an uncompressed picture and does not require QuickTime to be displayed.DESCRIPTION
TheCompressPictureFile
function compresses only image data. Any other types of data in the file, such as text, graphics primitives, and previously compressed images, are not modified in any way and are passed through to the destination picture. This function does not use the graphics port.This function supports parameters governing image quality and compressor type. The compressor infers the other compression parameters from the image data in the source picture file.
SPECIAL CONSIDERATIONS
TheCompressPictureFile
function doesn't compress pictures that contain compressed data. Do not alter data in pictures that are already compressed. Instead useFCompressPictureFile
, described in the next section.RESULT CODES
File Manager errors
noErr 0 No error paramErr -50 Invalid parameter specified memFullErr -108 Not enough memory available noCodecErr -8961 The Image Compression Manager could not find the specified compressor SEE ALSO
If you need more control over the compression operation, use theFCompressPictureFile
function.